package com.bidevalution.business.service;

import java.util.List;
import java.util.Map;

import org.springframework.util.StringUtils;

import com.bidevalution.business.context.StepStage;
import com.bidevalution.dao.entity.BeSectionStep;
import com.bidevalution.dao.entity.BeSectionStepJob;

public interface BeSectionStepJobService {
	List<BeSectionStepJob> selectListByStepId(String sectionStepId);
	void callStepUnionJob(BeSectionStep beSectionStep,String submitCode,String expertId,String layoutCode, StepStage stage)throws Exception;
//	void callRowJob(String sectionStepId, String submitCode, String expertId, String layouCode,
//			StepStage stepStage, Map<String, Object> rowData)
//			throws Exception;
	void callSectionJob(String sectionStepId, String submitCode, StepStage stage, String expertId, String layoutCode,
			String isFinish, Integer jobState) throws Exception;
	void callStepJob(BeSectionStep beSectionStep, String submitCode, StepStage stage, String expertId, String layoutCode) throws Exception;
	List<BeSectionStepJob> findUnFinishList(String sectionId);

	List<BeSectionStepJob> findUnFinishList(BeSectionStepJob beSectionStepJob);
	/**
	 * 根据环节id更新环节任务状态
	 *
	 * @param sectionStepId
	 * @param status
	 * @throws Exception
	 */
	void updateStepJobByStepId(String sectionStepId, String status) throws Exception;

    /**
     * 查询当天开标项目需要提前执行的任务且处于可以执行状态
     *
     * @return
     */
    List<BeSectionStepJob> queryAdvanceExecuteJobToday();
    void executeJob(String expertId, String layoutCode, StepStage stage, String submitCode,
			BeSectionStepJob beSectionStepJob, Map<String, Object> extendMap) throws Exception;
    int findUnFinishCnt(String sectionStepId);

	/**
	 * 根据标段id更新环节任务状态
	 *
	 * @param sectionId
	 * @return
	 * @throws Exception
	 */
	int updateStepJobBySectionId(String sectionId) throws Exception;
}
